#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>

int main()
{
	int n = 0;
	scanf("%d", &n);
	int i = 4;
	int num = n;
	int sum = n;
	while (i)
	{
		n = n*10;
		num = num + n;
		sum = sum + num;
		i--;
	}
	printf("%d\n", sum);
}